#ifndef _SYS_CHARSET_H_
#define _SYS_CHARSET_H_

#include "FanObj.h"
#include "SysTypes.h"

#define CHARSET_VTABLE(self)   ((CharsetVTable*)((FanObj*)self)->vtable)


extern Type*    Charset_classType;
extern VTable*  Charset_classVTable;


/* [sys::Charset] Attributes */
struct Charset
{
  FanObj        super;
};


/* [sys::Charset] Virtual-table */
typedef struct CharsetVTable
{
  FanObjVTable  super;
} CharsetVTable;


/* [sys::Charset] Methods and fields */
Bool            Charset_equals(Obj self, NullableObj obj);
Int             Charset_hash(Obj self);
Str*            Charset_toStr(Obj self);
Charset*        Charset_fromStr_1(Str* name);
Charset*        Charset_fromStr(Str* name, Bool checked);
Charset*        Charset_defVal(void);
Charset*        Charset_utf8(void);
Charset*        Charset_utf16BE(void);
Charset*        Charset_utf16LE(void);
Str*            Charset_name(Charset* self);


/* [sys::Charset] Extra methods */
void            Charset_encode(Charset* self, Int ch, OutStream* out);
void            Charset_encodeToInstream(Charset* self, Int ch, InStream* in);
NullableInt     Charset_decode(Charset* self, InStream* in);


/* [sys::Charset] Type-system functions */
Type*           Charset_initType(void);
VTable*         Charset_initVTable(void);
void            Charset_initStatic(void);


#endif
